// 云函数入口文件
const cloud = require('wx-server-sdk')
const db = cloud.database()
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
})

// 云函数入口函数
exports.main = async (event, context) => {
  try {
    //删除音频文件
   var audioList=db.collection("audio").where({
      bookId:event.bookId
    })
    console.log(audioList);return;

    //删除记录
    return await db.collection("audio").where({
      bookId: event.bookId
    }).remove()

  } catch (e) {
    console.error(e)
  }
}